package com.ie.controller.admin;

import com.ie.common.security.anno.AuthIgrone;
import com.ie.entity.OrdersEntity;
import com.ie.sevice.admin.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/admin/orders")
public class OrdersController {

    @Autowired
    private OrdersService ordersService;


    @AuthIgrone
    @PostMapping("/getOrdersByUid")
    public Map<String, Object> getOrdersByUid(
            @RequestBody Map<String, Integer> request) {
        Integer uid = request.get("uid");
        Integer pageNum = request.get("pageNum");
        Integer pageSize = request.get("pageSize");

        // 调用 Service 获取分页数据
        return ordersService.getOrdersByUidWithPage(uid, pageNum, pageSize);
    }
}